package com.lx.tldoj.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lx.tldoj.model.dto.competition.CompetitionQueryRequest;
import com.lx.tldoj.model.entity.Competition;
import com.lx.tldoj.model.vo.CompetitionVO;

import javax.servlet.http.HttpServletRequest;

/**
* @description 针对表【competition(题目)】的数据库操作Service
* @createDate 2023-08-07 20:58:00
*/
public interface CompetitionService extends IService<Competition> {


    /**
     * 校验
     *
     * @param competition
     * @param add
     */
    void validCompetition(Competition competition, boolean add);

    /**
     * 获取查询条件
     *
     * @param competitionQueryRequest
     * @return
     */
    QueryWrapper<Competition> getQueryWrapper(CompetitionQueryRequest competitionQueryRequest);
    
    /**
     * 获取题目封装
     *
     * @param competition
     * @param request
     * @return
     */
    CompetitionVO getCompetitionVO(Competition competition, HttpServletRequest request);

    /**
     * 分页获取题目封装
     *
     * @param competitionPage
     * @param request
     * @return
     */
    Page<CompetitionVO> getCompetitionVOPage(Page<Competition> competitionPage, HttpServletRequest request);
    
}
